package com.spring.demos.ioccontainer.pojo;

public class CarFactory {

    public CarFactory() {

    }

    public static Car getCarInstance(String carType){
        if("benZi".equalsIgnoreCase(carType)){
            return new BenZiCar("https:www.image.com/benzi.png",500.0f,100.0f,"奔驰III");
        }else if("baoMa".equalsIgnoreCase(carType)){
            return new BaoMaCar("https:www.image.com/baoma.png",400.0f,80f,"宝马II");
        }
        return new BenTianCar("https:www.image.com/bentian.png",200.0f,20f,"本田I");
    }

}
